<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>

<body>
    <form action="http://localhost:8848/users/login" method="POST">
        用户名:<input type="text" name="username"> <br />
        密码:<input type="text" name="password" id="">
        <input type="submit" value="提交">
    </form>
    <ul id="uu"></ul>
</body>

</html>
<script src="template-web.js"></script>
<script id="position" type="text/html">
    {{each data value i}}
        <li>
            {{value.positionName}}
            <img src="{{value.companyLogo}}" alt="">
        </li>
    {{/each}}
</script>
<script>
    //原生的 fetch
    fetch("http://localhost:8848/positions/getlist?count=6")
        .then(body => body.json())
        .then(res => {
            console.log(res)
            //第二个参数必须传入一个object类型的数据
            var html = template("position", res)
            document.getElementById("uu").innerHTML = html
        })
</script>